#pragma once
#include <tchar.h>
#include <iostream>
#include <objbase.h>
#include <comutil.h>
using namespace std;

class DBProc
{
public:
	DBProc(void);
	~DBProc(void);
	_bstr_t GetWordOfDic(_bstr_t word,_bstr_t dicname,_bstr_t dictype);
	_bstr_t GetMeanOfWord(_bstr_t word,_bstr_t dicname,_bstr_t dictype);
	bool AddWord(_bstr_t pronoun,_bstr_t word,_bstr_t dic,
		_bstr_t mean,_bstr_t type,_bstr_t exam,int flag = 0);//flag = 0:add all,flag = 1:add only mean
	int AddWordOnly(_bstr_t pronoun,_bstr_t word,_bstr_t namedic = "Default",_bstr_t typedic = "Anh-Viet");//1:sucess,0:da ton tai tu;-1:loi;-2:query khong thanh cong
	int AddMeanOnly(_bstr_t word,_bstr_t mean,_bstr_t type,_bstr_t exam,_bstr_t dicname,_bstr_t dictype);
	int AddRefWord(_bstr_t word,_bstr_t refword,_bstr_t type);
	bool DeleteWord(_bstr_t word);
	_bstr_t CountWord(_bstr_t dicName = "Default", _bstr_t dicType = "Anh-Viet");
	_bstr_t ListWord(_bstr_t dicName = "Default",_bstr_t dicname = "Anh-Viet");
	_bstr_t ListDict();
	bool AddDic(_bstr_t type,_bstr_t name );
	bool IsExist(_bstr_t param,int flag,_bstr_t param2 = "",_bstr_t param3 = "",_bstr_t param4 = "");//0:exist,1:not exist
	//param 3:dicname,param4 :dictype
};

